package com.yyx.app1.My_function.Controls.MyQuestion;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.yyx.app1.Data.Question.Question_Activity_Data;
import com.yyx.app1.Data.testDate;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2015/10/24.
 */
public class Item_Question_Progress_Adapter extends BaseAdapter {
    private List<Question_Activity_Data> data;
    private Context context;

    public Item_Question_Progress_Adapter(Context context) {
        this.context = context;
    }
    public void findAll()
    {
        data = new ArrayList<>();
        data.add(new Question_Activity_Data("01", Question_Activity_Data.QuestionStatusType.Process,"琪琪","爱斯基摩犬",new testDate().strings[13],"泪腺阻塞对于爱宠主人来说可能并不陌生，重要的症状是泪溢，" +
                "造成眼部下面的皮肤染成棕褐色，严重影响了爱宠的美观，不明白真相的家长还以为是\"流血\"了，这究竟是怎么回事",new String[]{new testDate().strings[14]},"2015/11/4 15:27"));
        data.add(new Question_Activity_Data("02", Question_Activity_Data.QuestionStatusType.Process,"琪琪","爱斯基摩犬",new testDate().strings[15],"泪腺阻塞对于爱宠主人来说可能并不陌生，重要的症状是泪溢，" +
                "造成眼部下面的皮肤染成棕褐色，严重影响了爱宠的美观，不明白真相的家长还以为是\"流血\"了，这究竟是怎么回事",new String[]{new testDate().strings[1]},"2015/11/4 15:27"));
        data.add(new Question_Activity_Data("03", Question_Activity_Data.QuestionStatusType.Process,"琪琪","爱斯基摩犬",new testDate().strings[2],"泪腺阻塞对于爱宠主人来说可能并不陌生，重要的症状是泪溢，" +
                "造成眼部下面的皮肤染成棕褐色，严重影响了爱宠的美观，不明白真相的家长还以为是\"流血\"了，这究竟是怎么回事",new String[]{new testDate().strings[0]},"2015/11/4 15:27"));
    }
    @Override
    public int getCount() {
        return data.size();
    }

    @Override
    public Object getItem(int position) {
        return data.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ItemView_Question it;
        if (convertView==null)
        {
            it = ItemView_Question_.build(context);
        }
        else
        {
            it = (ItemView_Question)convertView;
        }
        it.bind(data.get(position));
        return it;
    }
}
